function regTest(val) {
  let reg = /\{\{(.+?)\}\}/;
  if (reg.test(val)) {
    let v = RegExp.$1;
    console.dir(v);
  }
}

regTest("{{ msg | trans}}");


const obj = {
  return: 123,
  let: 1,
  Class: 123
}
console.log(obj);

function Foo(m, n) {
  let ret = m + n
  this.m = m
  this.n = n
  return ret
}

// 01 普通函数调用
let ret = Foo(10, 20)
console.log(ret)

// 02 构造函数执行
let res = new Foo(20, 20)
console.log(res)

function changeObjProperty(o) {
  o.siteUrl = "http://www.baidu.com"
  o = new Object()
  o.siteUrl = "http://www.google.com"
}
let webSite = new Object();
changeObjProperty(webSite);
console.log(webSite.siteUrl);

console.log(a)
var a = 123
function a() {
  return 1
}

const AA = {
  user: { role: 1, name: "zgl", child: [{ user: { name: "cc" } }] },
};
const { user: { role: num } } = AA;
console.log(num);

function Foo() {
  var i = 0;
  return function () {
    console.log(i++);
  }
}
var f1 = Foo();
var f2 = Foo();
f1();
f1();
f2();

